cmake_minimum_required(VERSION 3.8)
project(test_launch)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(action_interface REQUIRED)

add_executable(launch_cin_exec src/launch_cin.cpp)
ament_target_dependencies(launch_cin_exec rclcpp)

add_executable(loop_get_param_exec src/loop_get_param.cpp)
ament_target_dependencies(loop_get_param_exec rclcpp)

add_executable(remap_node_exec src/remap_node.cpp)
ament_target_dependencies(remap_node_exec rclcpp std_msgs std_srvs rclcpp_action action_interface)

add_executable(output_type_node_exec src/output_type_node.cpp)
ament_target_dependencies(output_type_node_exec rclcpp std_msgs std_srvs rclcpp_action action_interface)

add_executable(respawn_node_exec src/respawn_node.cpp)
ament_target_dependencies(respawn_node_exec rclcpp)

add_executable(robot_upstart_restart_node_exec src/robot_upstart_restart_node.cpp)
ament_target_dependencies(robot_upstart_restart_node_exec rclcpp)

install(TARGETS 
  launch_cin_exec 
  loop_get_param_exec 
  remap_node_exec
  output_type_node_exec
  respawn_node_exec
  robot_upstart_restart_node_exec
  DESTINATION lib/${PROJECT_NAME}
)

install(DIRECTORY launch
DESTINATION share/${PROJECT_NAME})

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  # the following line skips the linter which checks for copyrights
  # comment the line when a copyright and license is added to all source files
  set(ament_cmake_copyright_FOUND TRUE)
  # the following line skips cpplint (only works in a git repo)
  # comment the line when this package is in a git repo and when
  # a copyright and license is added to all source files
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()
